import { BasicColumn } from '/@/components/Table';
import { render } from '/@/utils/common/renderUtils';
import { useI18n } from '/@/hooks/web/useI18n';
import { FormSchema } from '/@/components/Table';
const { t } = useI18n('asset.inventoryManagement.fields');
const { t: asset } = useI18n('asset.assetInfo.fields');
const inventoryField = {
  inventoryNumber: t('inventory_number'),
  inventoryName: t('inventory_name'),
  checkState: t('check_state'),
  inventoryState: t('inventory_state'),
  inventoryWay: t('inventort_way'),
  notes: t('notes'),
  inventoryPerson: t('inventory_person'),
  inventoryTime: t('inventoryTime'),
  createTime: t('createTime'),
  createBy: t('createBy'),
  inventory_type: t('inventory_type'),
  count: t('count'),
  actualCount: t('actualCount'),
  actualPosition: t('actualPosition'),
  difference: t('difference'),
  inventoryLoss: t('inventoryLossNumber'),
};
//列表数据
export const columns: BasicColumn[] = [
  {
    title: inventoryField.inventoryNumber,
    align: 'center',
    dataIndex: 'inventoryNumber',
  },
  {
    title: inventoryField.inventoryLoss,
    align: 'center',
    dataIndex: 'inventoryLoss',
  },
  {
    title: inventoryField.inventoryName,
    align: 'center',
    dataIndex: 'inventoryName',
  },
  {
    title: inventoryField.notes,
    align: 'center',
    dataIndex: 'notes',
  },
  {
    title: inventoryField.createBy,
    align: 'center',
    dataIndex: 'createBy',
  },
  {
    title: inventoryField.createTime,
    align: 'center',
    dataIndex: 'createTime',
  },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: inventoryField.inventoryNumber,
    field: 'inventoryNumber',
    component: 'Input',
  },
  {
    label: inventoryField.createTime,
    field: 'createTime',
    component: 'RangePicker',
  },
];
//查看详情数据
export const detailColumns: BasicColumn[] = [
  {
    title: asset('cartegory'),
    align: 'center',
    dataIndex: 'cartegory',
  },
  {
    title: asset('code'),
    align: 'center',
    dataIndex: 'code',
  },
  {
    title: asset('name'),
    align: 'center',
    dataIndex: 'assetName',
  },
  {
    title: asset('position'),
    align: 'center',
    dataIndex: 'assetName',
  },
  {
    title: inventoryField.count,
    align: 'center',
    dataIndex: 'count',
  },
  {
    title: inventoryField.actualCount,
    align: 'center',
    dataIndex: 'actualCount',
  },
  {
    title: inventoryField.difference,
    align: 'center',
    dataIndex: 'difference',
  },
];
//盘点根据资产名称子表
// export const sonColumns: BasicColumn[] = [
//   {
//     title: inventoryField.inventoryState,
//     align: 'center',
//     dataIndex: 'inventoryState',
//     customRender: ({ text }) => {
//       return render.renderDict(text, 'inventoryState', true, { 完成: 'green' });
//     },
//   },
//   {
//     title: inventoryField.inventoryPerson,
//     align: 'center',
//     dataIndex: 'inventoryPerson',
//   },
//   {
//     title: '资产状态',
//     align: 'center',
//     dataIndex: 'inventoryPerson',
//   },
//   {
//     title: '规格',
//     align: 'center',
//     dataIndex: 'inventoryPerson',
//   },
//   {
//     title: asset('user'),
//     align: 'center',
//     dataIndex: 'user',
//   },
//   {
//     title: asset('custodyDepartment'),
//     align: 'center',
//     dataIndex: 'custodyDepartment',
//   },
//   {
//     title: asset('code'),
//     align: 'center',
//     dataIndex: 'code',
//   },
//   {
//     title: inventoryField.count,
//     align: 'center',
//     dataIndex: 'count',
//   },
//   {
//     title: inventoryField.actualCount,
//     align: 'center',
//     dataIndex: 'actualCount',
//   },
//   {
//     title: inventoryField.difference,
//     align: 'center',
//     dataIndex: 'difference',
//   },
//   {
//     title: inventoryField.actualPosition,
//     align: 'center',
//     dataIndex: 'actualPosition',
//   },
// ];
